home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / tcomm50.zip / LWXM.DOC < prev    next >
Text File  |  1987-10-07  |  22KB  |  855 lines

  1.  
  2.  
  3.  
  4.  
  5.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  6.          for Datalight and Turbo C
  7.  
  8.  
  9.               -CONTENTS-
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16. INTRODUCING LWXM. . . . . . . . . . . . . . . . . . . . .  1
  17.  
  18.   DIFFERENCES BETWEEN XMODEM AND WXMODEM. . . . . . . . .  1
  19.  
  20.   PROTOCOL FUNDAMENTALS . . . . . . . . . . . . . . . . .  2
  21.     THE TRANSMISSION BLOCK. . . . . . . . . . . . . . . .  2
  22.     THE INTER-COMPUTER DIALOG . . . . . . . . . . . . . .  3
  23.  
  24. THE WLXM ENGINE . . . . . . . . . . . . . . . . . . . . .  3
  25.  
  26.   OVERVIEW. . . . . . . . . . . . . . . . . . . . . . . .  4
  27.  
  28.   MAJOR ENGINE COMPONENTS . . . . . . . . . . . . . . . .  5
  29.  
  30.   NOTES AND WARNINGS. . . . . . . . . . . . . . . . . . .  6
  31.     MODIFICATIONS . . . . . . . . . . . . . . . . . . . .  6
  32.     PARITY AND DATA BITS. . . . . . . . . . . . . . . . .  6
  33.     INTERNAL TIMER FUNCTION . . . . . . . . . . . . . . .  6
  34.     BUFFER SIZE RESTRICTION . . . . . . . . . . . . . . .  7
  35.     XON-XOFF CONTROL. . . . . . . . . . . . . . . . . . .  7
  36.  
  37.   USER-ACCESSABLE DATA. . . . . . . . . . . . . . . . . .  8
  38.  
  39. PROGRAMMERS REFERENCE . . . . . . . . . . . . . . . . . .  8
  40.  
  41.   ENGINE-RELATED FUNCTIONS. . . . . . . . . . . . . . . .  9
  42.     lwxrrec . . . . . . . . . . . . . . . . . . . . . . . 10
  43.     lwxtrec . . . . . . . . . . . . . . . . . . . . . . . 12
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  67.          for Datalight and Turbo C
  68.  
  69.  
  70.        DIFFERENCES BETWEEN XMODEM AND WXMODEM
  71.  
  72.  
  73.  
  74.  
  75.  
  76. This is  not  intended to  be  a strict  tutorial  on either
  77. XMODEM or Windowed XMODEM (WXMODEM). We assume that you have
  78. already read,  digested,  and understood  the documentataion
  79. provided for the LXM (XMODEM)  engine.  If not, your reading
  80. should begin there.
  81.  
  82. The  xmodem  protocol,  while  very  popular  and a  defacto
  83. standard does have some built-in deficiencies.  At least one
  84. of these has been addressed by a variant,  that of the block
  85. checking  used  in  the original  protocol.  But some  other
  86. deficiencies also exist.  Chief among these deficiencies are
  87. the  amount   of   time  required   to  'turn   around'  the
  88. transmission line  after  each block  is sent to  permit the
  89. receiver  to  acknowledge successful  receipt of  the block.
  90. This  turn-around   time  is   further  complicated  by  the
  91. relatively short block length,  and as a result,  the number
  92. of times this  turn-around occurs  while transferring a file
  93. of any substantial size.
  94.  
  95. A second area of concern  for those who study communications
  96. protocols is the  relative ease  with which xmodem can loose
  97. synchronism between the sender and receiver,  permitting the
  98. protocol  to   be  fooled.   Several  approaches  have  been
  99. developed  within  the  xmodem  framework  to  address  this
  100. problem,  but these must be viewed  as work-around's that do
  101. not really correct the problem, but rather mask the symptoms
  102. of the problem.
  103.  
  104. Finally,  xmodem   does  does    perform  well  over  certain
  105. packet-based networks,  such as TELENET.  This is  largely a
  106. result of the  the network's speed,  and the use of XON-XOFF
  107. flow control. Most xmodem implimentations, ours included, to
  108. not respond well to what the sender perceives to be spurious
  109. characters on  the line,  the XON  and XOFF.  In some cases,
  110. xmodem will not function at all. In others, there may be the
  111. needless  retransmission  of  blocks because  of the  way in
  112. which the XON and XOFF are handled.
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.       CopyRight (c) 1987, Information Technology, Ltd.
  121. INTRODUCING LWXM                    Page 1
  122.  
  123.  
  124.  
  125.  
  126.  
  127.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  128.          for Datalight and Turbo C
  129.  
  130.  
  131.            PROTOCOL FUNDAMENTALS
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140. THE TRANSMISSION BLOCK
  141.  
  142.  
  143. WXMODEM  transmission  blocks  closely   mirror  the  xmodem
  144. standard with several important distinctions. To improve the
  145. ability of WXMODEM  to handle false  blocks or false Ends of
  146. Transmission (EOT),  an additional character  has been added
  147. to the block,  SYN.  To successfully recognize the begiining
  148. of a block,  the receiving program must successfully get one
  149. or more SYN characters followed  by the traditional SOH used
  150. by xmodem.
  151.  
  152. While the  addition of  a synchronizing character helps,  it
  153. does  not  completely  eliminate   the  possibility  of  the
  154. receiver  or  sender  being  fooled,  resulting  in  aborted
  155. transmission or  premature End  of File conditions.  To help
  156. correct these problems, WXMODEM requires that all characters
  157. in a block that might  cause confusion be escaped.  That is,
  158. WXMODEM  uses  a  technique  long  popular  in  the  area of
  159. synchronous  communications  called transparency.  Using the
  160. approach, certain data characters that might cause confusion
  161. when they appear in  a data block  are altered and sent in a
  162. special way that  can be  recognized easily by the receiver.
  163. In WXMODEM these characters are SYN, XON, XOFF, and DLE.  To
  164. send any of these characters as part of the data,  including
  165. the block  check,  WXMODEM requires  that  the character  be
  166. preceeded by a DLE,  and that a value of 64 (0x40)  be added
  167. to  the  actual  character  by   the  sender.  The  receiver
  168. recognizes the leading DLE, removes it from the data stream,
  169. and subtracts 64 (0x40) from the character that follows. The
  170. problem of EOT confusion is  addressed by a requirement that
  171. two consectutive  EOT's  be received  to be recognized  as a
  172. true End of File condition.
  173.  
  174. But perhaps the most unique design element in WXMODEM is the
  175. way in which  it address the  line turn-around delay that we
  176. discussed  earlier.   WXMODEM  does   not  require   that  a
  177. transmitted block be acknowledged immediately.  Rather,  the
  178. sender will continue  to transmit  data until upto  4 blocks
  179.  
  180.  
  181.       CopyRight (c) 1987, Information Technology, Ltd.
  182. INTRODUCING LWXM                    Page 2
  183.  
  184.  
  185.  
  186.  
  187.  
  188.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  189.          for Datalight and Turbo C
  190.  
  191.  
  192. have been sent before it (the sender)  will stop to wait for
  193. an  acknowledgment.  And  the  receiver is  not required  to
  194. acknowledge  each  block individually,  only the  last block
  195. that  was   successfully  received,   although  the  WXMODEM
  196. description in fact suggests that all blocks be acknowledged
  197. explicitly.  The effect is that the sender can pause briefly
  198. between blocks before starting  to send again.  The duration
  199. of the pause should only be long enough to determine whether
  200. there is any incoming acknowledgment to be handled. There is
  201. no timeout interval as in  xmodem until the 'window closes',
  202. i.e. the sender has sent 4 unacknowledged blocks.
  203.  
  204.  
  205.  
  206.  
  207. THE INTER-COMPUTER DIALOG
  208.  
  209.  
  210. Rather than re-invent the wheel,  we have included a copy of
  211. the WXMODEM description, as developed by Peter Boswell. This
  212. document  is  in  the file  WXMODEM.DOC for  those  who wish
  213. further information on the subject.
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.       CopyRight (c) 1987, Information Technology, Ltd.
  243. THE WLXM ENGINE                        Page 3
  244.  
  245.  
  246.  
  247.  
  248.  
  249.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  250.          for Datalight and Turbo C
  251.  
  252.  
  253.               OVERVIEW
  254.  
  255.  
  256.  
  257.  
  258.  
  259. The design of  the WLXM engine  closely mirrors that  of the
  260. original LXM engine,  giving both capability and flexibility
  261. in the  use  of communications protocols.  Indeed,  the WLXM
  262. engine employs many of the same  kernel routines used by our
  263. LXM engine.  As with LXM, virtually any application can have
  264. access to this  xmodem enhancement,  without being religated
  265. to simply transferring files.
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.       CopyRight (c) 1987, Information Technology, Ltd.
  304. THE WLXM ENGINE                        Page 4
  305.  
  306.  
  307.  
  308.  
  309.  
  310.       LWXM(tm) - LITECOMM (tm) WINDOWED XMODEM ENGINE
  311.          for Datalight and Turbo C
  312.  
  313.  
  314.           MAJOR ENGINE COMPONENTS
  315.  
  316.  
  317.  
  318.  
  319.  
  320. The  WLXM  engine  consists,  primarily  of  two  functions,
  321. lwxrrec and lwxtrec,  receive a record and transmit a record
  322. respectively.  As with LXM, these two functions 'understand'
  323. the wxmodem internally.  Due to the nature  of the protocol,
  324. and unlike xmodem,  they share the responsibility for proper
  325. operation with t